using System;
using MenusHunter.WinRT.Core.Models;
using MenusHunter.WinRT.Core.Services.Food;
using Windows.UI.Xaml.Data;

namespace MenusHunter.WinRT.Helpers
{
    public class FoodsStatusToStringConverter:IValueConverter
    {
        #region Implementation of IValueConverter

        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (!(value is int))
                return value;
            var foodStatus = (int) value;
            switch (foodStatus)
            {
                case (int) FoodStatus.SoldOut:
                    return "Sold Out";
                case (int) FoodStatus.InStock:
                    return "In Stock";
            }
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            return value;
        }

        #endregion
    }
}